package com.lsh.stack;

import java.util.Stack;

/**
 * @author ：LiuShihao
 * @date ：Created in 2020/7/30 3:09 下午
 * @desc ：栈  :原则：先进后出
 */
public class StackDemo {
    public static void main(String[] args) {
        Stack<String> strings = new Stack<>();
        strings.add("zhangsan");
        strings.add("lisi");
        strings.add("wangwu");
        while (strings.size()>0){
            System.out.println(strings.pop());
        }
    }
}
